package com.migration.model.migration.scripts;

import com.migration.model.migration.AbstractMigrationScript;

/**
 * 风险矩阵-严重性表(risk_matrix_severity)迁移脚本
 */
public class A018_RiskMatrixSeverityMigrationScript extends AbstractMigrationScript {

    /**
     * 构造函数，初始化迁移配置
     */
    public A018_RiskMatrixSeverityMigrationScript() {
        super(
            "risk_matrix_severity",
            "风险矩阵-严重性数据迁移",
            "ra_severity_grade",
            "risk_matrix_severity",
            18
        );
    }

    /**
     * 生成迁移数据的SQL
     *
     * @return 迁移数据的SQL
     */
    @Override
    protected String generateMigrationSql() {
        return "INSERT INTO risk_matrix_severity (\n" +
                "    id,\n" +
                "    tenant_id,\n" +
                "    severity_level,\n" +
                "    health_safety_impact,\n" +
                "    environmental_impact,\n" +
                "    property_damage,\n" +
                "    public_reputation_impact,\n" +
                "    sort_num,\n" +
                "    create_time,\n" +
                "    update_time,\n" +
                "    create_by,\n" +
                "    update_by,\n" +
                "    is_del\n" +
                ")\n" +
                "SELECT\n" +
                "    id,\n" +
                "    1 as tenant_id,\n" +
                "    grade,\n" +
                "    health_safety_effect,\n" +
                "    enviro_effect,\n" +
                "    asset_loss,\n" +
                "    community_fame_effect,\n" +
                "    index_sort,\n" +
                "    DATE_FORMAT(create_time, '%Y-%m-%d %H:%i:%s'),\n" +
                "    DATE_FORMAT(update_time, '%Y-%m-%d %H:%i:%s'),\n" +
                "    1,\n" +
                "    1,\n" +
                "    is_del\n" +
                "FROM risk_lunnan_test.ra_severity_grade\n" +
                "where tenant_id = 24;";
    }

}
